/*
练习模板方法
*/
#include <iostream>
template <typename T>
T lesser(T t1, T t2) {
    return t1 < t2 ? t1 : t2;
}

int main_lesser()
{
    int m = 10;
    int n = 200;
    using namespace std;
    cout << "m, n compare: " << lesser(m, n) << endl;
    double a = 12.342;
    double b = 4.323123;
    //!! 调用模板方法时候可以指定参数的类型，同时将入参强制转换
    cout << "a, b compare: " << lesser<int>(a, b) << endl;
    return 0;
}
